# -*- coding: utf-8 -*-
# @Time    : 2020/5/7 20:11
# @Author  : Jhin•W
# @Email   : 261229090@qq.com
# @File    : server.py
# @Software: PyCharm
#---------------------------------------------------

import socket

# SOCK_STREAM:TCP
# SOCK_Dgram:UDP
# family=AF_INET:服务器之间的通信
# family=AF_UNIX:Unix不同进程间通信

sk = socket.socket()
address = ('127.0.0.1', 8000)
sk.bind(address)
sk.listen(3)
print('waiting....')
conn, addr = sk.accept()

inp = input('>>>')
conn.send(bytes(inp, 'utf8'))

conn.close()